import {developmentUrl} from "../config/env";
import request from "../config/axios";
export const userTableData=(data)=>request({
    url:`${developmentUrl}/user/list?page=${data.page}&limit=${data.limit}`,
    method:"GET"
});
export const userDelete=(data)=>request({
    url:`${developmentUrl}/user?userId=${data.userId}`,
    method:"DELETE"
});
export const userSearch=(data)=>request({
    url:`${developmentUrl}/user/list?page=${data.page}&limit=${data.limit}&account=${data.account}&name=${data.name}&sex=${data.sex}`,
    method:"GET"
})
export const userAdd=(data)=>request({
    url:`${developmentUrl}/user?id=&account=${data.account}&name=${data.name}&birthday=${data.birthday}&sex=${data.sex}&email=${data.email}&password=${data.password}&rePassword=${data.rePassword}&dept=&status=${data.status}&deptid=${data.deptid}&deptName=${data.deptName}&phone=${data.phone}&createtime=${data.createtime}`,
    method:"POST"
});
export const deptList=()=>request({
    url:`${developmentUrl}/dept/list`,
    method:"GET"
})
export const userModify=(data)=>request({
    url:`${developmentUrl}/user?birthday=${data.birthday}&modifyBy=${data.modifyby}&deptName=${data.deptName}&salt=vscp9&roleid=${data.roleid},&sex=${data.sex}&deptid=${data.deptid}&password=&modifyTime=modifyTime&createTime=${data.createTime}&phone=${data.phone}&sexName=${data.sexName}&name=${data.name}&roleName=${data.roleName}&statusName=${data.stausName}&id=${data.id}&account=${data.account}&email=${data.email}&status=${data.status}&createtime=${data.createtime}`,
    method:"POST"
})
export const userRoleList=(data)=>request({
    url:`${developmentUrl}/role/roleTreeListByIdUser?idUser=${data.idUSer}`,
    method:"GET"
})
export const userRoleModify=(data)=>request({
    url:`${developmentUrl}/user/setRole?userId=${data.userId}&roleIds=${data.roleIds}`,
    method:"GET"
})